home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / PROC-ARM.{21 / IO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-17  |  1.3 KB  |  39 lines

  1. /*
  2.  * linux/include/asm-arm/proc-armv/io.h
  3.  */
  4.  
  5. /*
  6.  * The caches on some architectures aren't dma-coherent and have need to
  7.  * handle this in software.  There are two types of operations that
  8.  * can be applied to dma buffers.
  9.  *
  10.  *  - dma_cache_wback_inv(start, size) makes caches and RAM coherent by
  11.  *    writing the content of the caches back to memory, if necessary.
  12.  *    The function also invalidates the affected part of the caches as
  13.  *    necessary before DMA transfers from outside to memory.
  14.  *  - dma_cache_inv(start, size) invalidates the affected parts of the
  15.  *    caches.  Dirty lines of the caches may be written back or simply
  16.  *    be discarded.  This operation is necessary before dma operations
  17.  *    to the memory.
  18.  *  - dma_cache_wback(start, size) writes back any dirty lines but does
  19.  *    not invalidate the cache.  This can be used before DMA reads from
  20.  *    memory,
  21.  */
  22.  
  23. #include <asm/proc-fns.h>
  24.  
  25. extern inline void dma_cache_inv(unsigned long start, unsigned long size)
  26. {
  27.     processor.u.armv3v4._cache_purge_area(start, start + size);
  28. }
  29.  
  30. extern inline void dma_cache_wback(unsigned long start, unsigned long size)
  31. {
  32.     processor.u.armv3v4._cache_wback_area(start, start + size);
  33. }
  34.  
  35. extern inline void dma_cache_wback_inv(unsigned long start, unsigned long size)
  36. {
  37.     processor.u.armv3v4._flush_cache_area(start, start + size, 0);
  38. }
  39.